#include <iostream>
#include<vector>
using namespace std;

int main() {
    int n, x;
    cin >> n;
      cin>> x;
    vector<int> container(n);
    for (int i = 0; i < n; i++)
    {
        cin >> container[i];
    }
    int left = 0, right = 0, sum = 0, flag = INT_MAX, flag1 = INT_MAX;
    while (right < container.size())
    {
        sum += container[right];
      
        while (sum >= x)
        {
            sum -= container[left++];
           

        }
        flag = min(flag, left);
        flag1 = min(flag1, right);
        right++;
    }
    cout << flag << " " << flag1;
    return 0;

}